home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / batchfactory / scripts / imagefx / image-fx_gradual_contrast next >
Encoding:
Text File  |  1995-01-12  |  2.0 KB  |  79 lines

  1. /* 
  2.                          IMAGE FX GRADUAL CONTRAST
  3.                                By J.L. White
  4.                           ©1994 Merlin's Software
  5.  
  6.          Apply Contrast To Sequence Of Images Gradually Over Time
  7.                               ImageFX Script
  8.  
  9.  Batch Factory Batch Conversion Scripts are basically Arexx scripts that
  10. allow you to pass certain parameters to the external program you wish
  11. to use to convert the images from one format to another. You can pass
  12. five different strings from Batch Factory to the script by using the
  13. following commands:
  14.  
  15. $N = This will pass the current selected filename.
  16. $P = This will tell Batch Factory to ask for a path to save new frames to.
  17. $# = This will pass the current frame number in the script.
  18. $T = This will pass the total number of frames in the script.
  19. $A = This will pass an offset number to be used to save frames with.
  20.  
  21. NOTE: The following line is required to work as a Batch Factory Script:
  22.  
  23. PARSE=$N $P $# $T $A
  24.  
  25. */
  26.  
  27. options results
  28. call Locate_ImageFX
  29.  
  30. address "IMAGEFX.1"
  31. arg InPic OutPic FrameNum TotalFiles AddNum
  32. SaveNum = FrameNum + AddNum
  33.  
  34. if FrameNum = 1 then do
  35.         ScreenToFront
  36.     Gadget.1 = 'Select Direction To Use!'
  37.     Gadget.2 = 'UP'
  38.     Gadget.3 = 'DOWN'
  39.     ListRequest 3 Gadget
  40.     if result = 2 then Answer = "UP"
  41.     if result = 3 then Answer = "DOWN"
  42.     call open TempFile,"Ram:IFGC",W
  43.     call writeln TempFile,Answer
  44.     call close TempFile
  45.     end
  46. else do
  47.     call open TempFile,"Ram:IFGC",R
  48.     line = readln(TempFile)
  49.     parse var line Answer
  50.     call close TempFile
  51.     end
  52. if FrameNum = TotalFiles then do
  53.     address command "delete >NIL: Ram:IFGC"
  54.     end
  55.  
  56. LoadBuffer InPic Force Smooth
  57. Num = ((FrameNum * 127)/(TotalFiles))
  58. if FrameNum > 1 then do
  59.     if Answer = "UP" then
  60.         Contrast Num
  61.     else
  62.         Contrast 0-Num
  63.     end
  64.  
  65. if OutPic = "SAME" then
  66.     SaveBufferAs ILBM InPic
  67. else
  68.     SaveBufferAs ILBM OutPic""right(SaveNum,3,'0')
  69. exit
  70.  
  71. Locate_ImageFX:
  72.     if (POS('IMAGEFX.1',SHOW('Ports')) = 0)
  73.     then do
  74.         address command 'run < nil: > nil: IMAGEFX:ImageFX'
  75.         address command 'wait 7'
  76.     end
  77. return
  78.  
  79.